package info.openlvb.openface.client.base.backup;

import com.google.gwt.user.client.ui.VerticalPanel;
import com.gwtext.client.data.SimpleStore;
import com.gwtext.client.data.Store;
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.TextField;

public class AddBackupPanel extends VerticalPanel {

	TextField task_nm;
	ComboBox cb;
	
	public AddBackupPanel(){
		FormPanel formPanel = new FormPanel();
		formPanel.setFrame(true);
        formPanel.setTitle("Ajout d'une tâche de sauvegarde");
        formPanel.setLabelWidth(250);
        formPanel.setWidth(600);
		
        task_nm = new TextField("Nom de la tâche", "name_task", 250);
        task_nm.setAllowBlank(false);
        task_nm.setDisabled(false);
        formPanel.add(task_nm);
        
        final Store store = new SimpleStore("type",new String[]{"unique","régulière"});
        cb = new ComboBox();
		cb.setForceSelection(true);
		cb.setMinChars(1);
		cb.setFieldLabel("Type de sauvegarde");
		cb.setStore(store);
		cb.setDisplayField("type");
		cb.setMode(ComboBox.LOCAL);
		cb.setTriggerAction(ComboBox.ALL);
		cb.setEmptyText("Type de sauvegarde ...");
		cb.setLoadingText("Searching...");
		cb.setTypeAhead(true);
		cb.setSelectOnFocus(true);
		cb.setWidth(200);
        cb.setValueField("utilisateur");
        cb.setAllowBlank(false);
        cb.setEditable(false);
        
        formPanel.add(cb);
        
        add(formPanel);
	}
}
